<!DOCTYPE html>
<html>
	<head>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta charset="UTF-8">
		<title>全唐通</title>
		<link rel="stylesheet" href="//cdn.bootcss.com/weui/0.4.3/style/weui.min.css">
		<link rel="stylesheet" href="//cdn.bootcss.com/jquery-weui/0.8.0/css/jquery-weui.min.css">
		<link rel="stylesheet" href="css/index.css" />
		<link rel="stylesheet" href="css/driverAllow.css" />
		<script src="//cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
		<script src="//cdn.bootcss.com/jquery-weui/0.8.2/js/jquery-weui.min.js"></script>
		<script type="text/javascript" src="lib/fastclick.js"></script>
	</head>
	<body ontouchstart="">
		<div class="wrap">
			<div class="weui_cell header">
				<div class="weui_cell_hd" id="userInfo">
					<img src="img/uesr.png"/>
				</div>
			    <div class="weui_cell_bd weui_cell_primary">
			    </div>
			</div>
			<div class="evaluate-section">
				<div class="evaluate-tx">
					<img src="img/tx.png"/>
				</div>
				<div class="evaluate-name">
					<span class="driver-name">刘先生</span>
				</div>
				<div class="evaluate-number">
					<span class="driver-phoneNumber">138****1234</span>
				</div>
				<div class="evaluate-review">
					<img src="img/star_empty.png">
					<img src="img/star_empty.png">
					<img src="img/star_empty.png">
					<img src="img/star_empty.png">
					<img src="img/star_empty.png">
				</div>
				<div class="evaluate-aside">
					<p>请您为本次的服务进行评星，如您有任何建议和不满，请填写到下方，方便我们改进，谢谢您的合作，祝您生活愉快！</p>
					<textarea class="evaluate-text"></textarea>
				</div>
			</div>
			<div class="weui_cell">
	  			<button class="weui_btn" id="submit_advice" style="background-color: #007AFF;">提交评价</button>
	  		</div>
  		</div>
  		<!-- 遮幕层 -->
  		<div class="modal-wall"></div>
  		<!--侧边栏-->
		<div class="weui_cells left-menu" id="left_menu">
			<div class="weui_cell usercenter">
				<div class="weui_cell_hd" >
					<img src="img/uesr.png"/>
				</div>
			    <div class="weui_cell_bd weui_cell_primary">
			    	<p class="user_number"></p>
			    </div>
			</div>
			<div class="weui_cell" id="orderlist">
				<div class="weui_cell_hd">
					<img src="img/banknote.png"/>
				</div>
			    <div class="weui_cell_bd weui_cell_primary">
			    	<p>行程</p>
			    </div>
			</div>
			<div class="weui_cell" id="bag">
				<div class="weui_cell_hd">
					<img src="img/banknote.png"/>
				</div>
			    <div class="weui_cell_bd weui_cell_primary">
			    	<p>钱包</p>
			    </div>
			</div>
			<div class="weui_cell" id="set">
				<div class="weui_cell_hd">
					<img src="img/banknote.png"/>
				</div>
			    <div class="weui_cell_bd weui_cell_primary">
			    	<p>设置</p>
			    </div>
			</div>
			<div class="weui_cell" id="download">
				<div class="weui_cell_hd">
					<img src="img/download.png"/>
				</div>
			    <div class="weui_cell_bd weui_cell_primary">
			    	<p >下载全唐通</p>
			    </div>
			</div>
		</div>
		<!-- 查询行程 -->
		<div id="order-list" class="weui-popup-container">
		  	<div class="weui-popup-overlay"></div>
		  	<div class="weui-popup-modal">
				<ul class="menu-list">
				</ul>
				<button class="close-popup">关闭</button>
		  	</div>
		</div>
		<script type="text/javascript" src="js/sideMenu.js"></script>
  		<script type="text/javascript" src="js/build.js"></script>
  		<script type="text/javascript">
  			$(function(){
				var driver = JSON.parse(sessionStorage.DRIVER);
				$(".driver-name").text(driver.name);
				$(".driver-phoneNumber").text(driver.phoneNumber.replace(driver.phoneNumber.substr(3,4), "****"));
			})
			;(function(){
				var star = document.getElementsByClassName("evaluate-review")[0].children;
				var temp = [];
				for(var i = 0; i < star.length; i++){
					star[i].index = i;

					star[i].onclick = function(){
						for(var k = 0; k < star.length; k++){
							star[k].src = "img/star_empty.png";
						}
						for(var j = 0; j < this.index + 1; j++){
							star[j].src = "img/star_full.png";
						}
						temp = this.index + 1;
					}
				}

				$("#submit_advice").on("click", function(){
					if(temp == 0){
						$.toast("请重新评价","forbidden",function(){
							window.location.reload();
						})
					}else{
						$.showLoading("正在发送评价");
						// window.location.href = "index.html";
						$.ajax({
							type: "get",
							url: "http://qtt.tunnel.qydev.com/taxi/report",
							dataType: "jsonp",
							data: {
								reviews: temp,
							},
							jsonp: "callback",
							jsonpCallback: "callback",
							success: function(data){
								$.hideLoading();
								if(data.code == "200"){
									$.toast("评价成功，感谢您的使用！",function(){
										window.location.href = "index.html";
									})
								}else{
									$.toast("请重新评价",function(){
										window.location.reload();
									})
								}
							}
						})
					}
				});
			})()
  		</script>
	</body>
</html>